﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../Lib/Css/site.css" rel="stylesheet" />
    <script src="../Lib/Js/jquery.min.js"></script>
    <script src="../Lib/Js/JSXTransformer.js"></script>
    <script src="../Lib/Js/react.js"></script>
</head>
<body>
    <p>JSX 允许直接在模板插入 JavaScript 变量。如果这个变量是一个数组，则会展开这个数组的所有成员(个人感觉用处不大...)</p>
    <div id="d1"></div>
</body>
</html>
<script type="text/jsx">
    var persons = [
        {name:"Damon",age:30},
        {name:"Carol",age:24}
    ];

    //var str = "[<h1>Hello world!</h1>,<h2>React is awesome</h2>,]";
    //var arr = eval("("+str+")");

    var arr = [
        <h1>Hello world!</h1>,
        <h2>React is awesome</h2>,
    ];

    React.render(
        <div>{arr}</div>,
        $("#d1").get(0)
    );
</script>
